package com.csii.ams.service.impl;

import com.csii.ams.ArchAbn;
import com.csii.ams.mapper.ArchAbnMapper;
import com.csii.ams.service.ArchAbnService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @description: 档案异常
 * @author: panChuanJiang
 * @create: 2021-03-18 17:13
 */
@Service("archAbnService")
public class ArchAbnServiceImpl implements ArchAbnService {
    @Resource
    private ArchAbnMapper archAbnMapper;

    @Override
    public void insertArchAbn(ArchAbn archAbn) {
        ArchAbn abn = archAbnMapper.selectByPrimaryKey(archAbn);
        if (abn != null) {
            archAbnMapper.updateArchAbn(archAbn);
        } else {
            archAbnMapper.insertArchAbn(archAbn);
        }
    }

    @Override
    public void updateArchAbn(ArchAbn archAbn) {
        archAbnMapper.updateArchAbn(archAbn);
    }

    @Override
    public void deleteArchAbn(ArchAbn archAbn) {
        archAbnMapper.deleteByPrimaryKey(archAbn);
    }

    @Override
    public ArchAbn queryArchAbn(ArchAbn archAbn) {
        return archAbnMapper.selectByPrimaryKey(archAbn);
    }
}

